#include "actionservice.h"
#include "notify/notifynotification.h"
#include "contact/contactabstractcontact.h"

#include <QDebug>


namespace Service {

ActionService *ActionService::m_instance = NULL;

ActionService::ActionService(QObject *parent) :
    QObject(parent)
{
}


ActionService *ActionService::instance()
{
    if (m_instance == NULL)
        m_instance = new ActionService();
    return m_instance;
}


void ActionService::onBuzz() const
{
    emit buzz();
}


void ActionService::onShowEmotion() const
{
    emit showEmotion();
}


void ActionService::onTransferFile() const
{
    emit transferFile();
}


void ActionService::onRecordVoice() const
{
    emit recordVoice();
}


void ActionService::onNotificationClicked(const Notify::Notification *notification) const
{
    emit notificationClicked(notification);
}


void ActionService::onNotifyWidgetGeometryChanged()
{
    emit notifyWidgetGeometryChanged();
}


void ActionService::onNotificationWidgetClosed() const
{
    emit notificationWidgetClosed();
}


void ActionService::onContactClicked(Contact::AbstractContact *contact) const
{
    emit contactClicked(contact);
}


void ActionService::onContactTabClick(int index) const
{
    emit contactTabClicked(index);
}


void ActionService::onShowChatPage() const
{
    emit showChatPage();
}


void ActionService::onEmotionClicked(Emotion::AbstractEmotion *emotion) const
{
    emit emotionClicked(emotion);
}


void ActionService::onEmotionEntered(Emotion::AbstractEmotion *emotion) const
{
    emit emotionEntered(emotion);
}


void ActionService::onEmotionLeft() const
{
    emit emotionLeft();
}

/**
 * @brief ActionService::onMouseMoving
 * @param globalPos
 * Set mouse corsor of the main frame while the mouse is moving in another widget.
 */
void ActionService::onMouseMoving(const QPoint &globalPos)
{
    emit mouseMoving(globalPos);
}

} // namespace Service
